<template>
    <el-form ref="formRef" :model="formData" label-width="96.5px" @submit.prevent scroll-to-error>
        <el-form-item label="展示规则" class="zw_mb_0">
            <div class="show_rule">
                <el-checkbox v-model="formData.isShow" :true-label="2" :false-label="1" label="不公开展示" />
                <div class="show_rule_desc">
                    勾选后，商品将不会展示在商品分类/搜索商品页面，不影响商品在组件和活动中的使用。
                </div>
            </div>
        </el-form-item>
    </el-form>
</template>

<script setup>
import { reactive, ref } from 'vue';

const formRef = ref(null);
const formData = reactive({
    isShow: 1
});

// const validate = () => {
//     return new Promise((resolve, reject) => {
//         formRef.value.validate(res => {
//             if (res) {
//                 resolve();
//             } else {
//                 reject();
//             }
//         });
//     });
// };
defineExpose({
    // validate,
    formData
});
</script>

<style lang="scss" scoped>
.show_rule {
    .show_rule_desc {
        font-size: 12px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #969696;
        line-height: 18px;
    }
}
</style>
